process {
    withName: GAWK {
        ext.args2 = "'{ total += \$3 } END { print total/NR }'"
        ext.suffix = "txt"
    }
    withName: SAMTOOLS_VIEW {
        ext.args = { "--write-index --subsample ${meta.subsample_fraction}" }
    }
}
